package com.cl.short_video_java.web.role;

import com.cl.short_video_java.annotation.IsRole;
import com.cl.short_video_java.annotation.Login;
import com.cl.short_video_java.common.Const;
import com.cl.short_video_java.common.Result;
import com.cl.short_video_java.pojo.SysMenu;
import com.cl.short_video_java.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 付
 * @Date 2024-11-17 9:41
 * @Version 1.0
 * @description
 * @since 1.0
 */

@RestController
@RequestMapping("/admin/menu")
public class MenuController {

	private SysMenuService sysMenuService;

	MenuController(SysMenuService sysMenuService) {
		this.sysMenuService = sysMenuService;
	}

	@GetMapping("/list")
	@Login(issuer = Const.GRADE_ADMIN)
	public Result list() {

		List<SysMenu> list = sysMenuService.selectAll();
		return Result.success(list);
	}

}
